home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / hcdemo.zip / GRINIT.INC < prev    next >
Text File  |  1993-01-04  |  601b  |  20 lines

  1. procedure Initialize(Var Gd:integer);
  2. Var
  3.    GraphMode, ErrorCode : Integer;
  4.  
  5. { Initialize graphics and report any errors that may occur }
  6. begin
  7.   { when using Crt and graphics, turn off Crt's memory-mapped writes }
  8.   DirectVideo := False;
  9.   Gd := Detect;  { Auto Detection }
  10.   GraphMode := Gd;
  11.   InitGraph(Gd, GraphMode, '');  { activate graphics }
  12.   ErrorCode := GraphResult;               { error? }
  13.   if ErrorCode <> grOk then
  14.   begin
  15.     Writeln('Graphics error: ', GraphErrorMsg(ErrorCode));
  16.     Halt(1);
  17.   end;
  18.   SetViewPort(0,0,GetMaxX,GetMaxY,ClipOn);
  19. end; { Initialize }
  20.